<template>
  <a-modal v-model="show" :centered="true" :keyboard="false" :footer="null" @cancel="handleCancleClick" title="题目选项">
    <a-layout>
      <a-table ref="TableInfo" :columns="columns" :rowKey="record => record.id" :dataSource="detailData.optionList">

        <template slot="option" slot-scope="text, record">
          <!-- ppvt的选项是图片，其他都是文字-->
          <img v-if="detailData.tableId == 129" :src="'/static/table_img' + record.imageUrl" />
          <span v-if="detailData.tableId != 129">{{ text }}</span>
        </template>

      </a-table>



    </a-layout>
  </a-modal>
</template>

<script>
export default {
  name: 'detail',
  props: {
    detailVisiable: {
      require: true,
      default: false
    },
    detailData: {
      require: true
    }
  },
  computed: {
    show: {
      get: function () {
        return this.detailVisiable
      },
      set: function () {
      }
    },
    columns() {
      return [{
        title: '选项',
        dataIndex: 'answerA',
        scopedSlots: { customRender: 'option' }
      }, {
        title: '选项分值',
        dataIndex: 'scoreA'
      }]
    }
  },
  mounted() {
  },
  methods: {
    handleCancleClick() {
      this.$emit('close')
    }
  }
}
</script>
<style lang="less" scoped>
@import "../../../static/less/Common";
</style>
